<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
	<jsp:include page="/WEB-INF/pages/common/meta.jsp"></jsp:include>
	<style>
		.layui-login-item{
			position: absolute;
		    left: 1px;
		    top: 1px;
		    width: 30px;
		    line-height: 36px;
		    text-align: center;
		    color: #d2d2d2;
		}
	
	</style>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/login/resource/layui/css/layui.css"/>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/login/css/base.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/login/css/common.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/login/css/index.css"/>
<%--   <link rel="stylesheet" href="<%=request.getContextPath()%>/login/loginStyleNew/admin.css" media="all"> --%>
<%--   <link rel="stylesheet" href="<%=request.getContextPath()%>/login/loginStyleNew/login.css" media="all"> --%>
</head>
<body>
	<form class="layui-form" name="objForm" id="objForm" method="post" action="<%=request.getContextPath()%>/sys/global/loginSuccessBh">
		<div class="login-box">
			<input type="text" class="username" placeholder="请输入用户名" name="login_id" id="login_id">
			<input type="password" class="password" placeholder="请输入密码" name="password" id="password">
			<input type="hidden" value="first" name="module_sign" id="module_sign"/>
			<span class="jzmm">记住密码</span>
			
			<div style="text-align: center;">
				<div id="login" class="login-btn" lay-submit="" lay-filter="lg" style="width: 49%;display: inline-block;">登录</div>
				<div class="login-btn" lay-submit="" lay-filter="register" style="width: 49%;display: inline-block;">注册</div>
		    </div>
		</div>
	</form>
</body>
<script src="<%=request.getContextPath()%>/login/loginStyleNew/layui/layui.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/login/resource/jquery/jquery-1.11.3.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/login/resource/part/particles.min.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=request.getContextPath()%>/login/resource/part/app.js" type="text/javascript" charset="utf-8"></script>
<script src="<%=request.getContextPath()%>/login/js/index.js" type="text/javascript"></script>
<script type="text/javascript">
  layui.use(['index', 'user', 'form'], function(){
	  var $ = layui.$
	    ,setter = layui.setter
	    ,admin = layui.admin
	    ,form = layui.form
	    ,router = layui.router()
	    ,search = router.search;
	    form.render();
	    //提交
	    form.on('submit(LAY-user-login-submit)', function(obj){
	    	jQuery.ajax({
				url:'<%=request.getContextPath()%>/sys/global/validateUser',
				type:'POST',
				data:{
					username: username,
					password: password,
					moduleSign: module_sign
				},
				dataType:'json',
				error:function(){
					layer.close(layer.index);
					layer.msg("用户名密码不正确");
				},
				success:function(data){
					layer.close(layer.index);
		         	if(data == 1){
		         		layer.msg("用户名密码不正确");
					}else if(data==2){
						layer.msg("用户名密码不正确");
					}else if(data==3){
						layer.msg("用户已被禁用");
					}else if(data==4){
						layer.msg("用户没有权限");
					}else if(data==5){
						document.objForm.submit();
					}
	            }
	    	});
	    });
  })
</script>
</html>